package com.wskh.edu.client;

import com.wskh.commonUtil.R;
import com.wskh.edu.client.impl.OssClientImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

/**
 * @author 王孙康宏
 */
@Component
// fallback: 开启熔断机制 RPC出错时（调用服务宕机时）调用OssClientImpl中的方法
@FeignClient(value = "service-oss",fallback = OssClientImpl.class)
public interface OssClient {
    @PostMapping(value = "/eduOss/fileOss/uploadAvatar")
    public R uploadAvatar(@RequestParam("file") MultipartFile file);

    @PostMapping(value = "/eduOss/fileOss/oss/{id}")
    public R testOss(@PathVariable String id);

    @PostMapping(value = "/eduOss/fileOss/deleteVideoById/{id}")
    public R deleteVideoById(@PathVariable(name = "id") String id);

}
